package com.ddstation.sewage.service;

import java.util.List;

import javax.inject.Inject;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ddstation.common.model.InvsCheckCommonSchParModel;
import com.ddstation.sewage.mapper.SewageMapper;
import com.ddstation.sewage.model.SewageDetailParModel;
import com.ddstation.sewage.model.SewageDetailResModel;
import com.ddstation.sewage.model.SewageResModel;

@Service
public class SewageServiceImpl implements SewageService {
	// 查询
	@Override
	@Transactional(readOnly=true)
	public List<SewageResModel> searchInstitutionSewageList(InvsCheckCommonSchParModel _in){
     	List<SewageResModel> list = sewageMapper.selectInstitutionSewageList(_in);
		return list;
	}
	
	// 生成诊所登记明细报表
	@Override
	@Transactional(readOnly=true)
	public List<SewageDetailResModel> searchInstitutionSewageDetailList(SewageDetailParModel _in){
     	// 查询诊所实际登记数据
 		List<SewageDetailResModel> listResult =  sewageMapper.selectDetail(_in);
		return listResult;
	}

	@Override
	@Transactional(readOnly=true)
	public boolean checkAccessAuthority(String invsInstitutionId,String institutionId){
		return sewageMapper.selectAccessAuthorityInstitution(invsInstitutionId, institutionId)>0;
	}
	
	@Inject private SewageMapper sewageMapper;
}
